{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Get models by prompts table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "df = pd.read_csv(\"Average_values_df.csv\",index_col=False)\n",
    "df.rename(columns={df.columns[0]: 'dataset'},inplace=True)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>dataset</th>\n",
       "      <th>None_None_command-xlarge-nightly</th>\n",
       "      <th>None_kojima-01_command-xlarge-nightly</th>\n",
       "      <th>None_zhou-01_command-xlarge-nightly</th>\n",
       "      <th>qa-10_None_command-xlarge-nightly</th>\n",
       "      <th>qa-12_None_command-xlarge-nightly</th>\n",
       "      <th>qa-13_None_command-xlarge-nightly</th>\n",
       "      <th>qa-16_None_command-xlarge-nightly</th>\n",
       "      <th>qa-17_None_command-xlarge-nightly</th>\n",
       "      <th>refl-01_None_command-xlarge-nightly</th>\n",
       "      <th>...</th>\n",
       "      <th>None_None_text-davinci-003</th>\n",
       "      <th>None_kojima-01_text-davinci-003</th>\n",
       "      <th>None_zhou-01_text-davinci-003</th>\n",
       "      <th>qa-10_None_text-davinci-003</th>\n",
       "      <th>qa-12_None_text-davinci-003</th>\n",
       "      <th>qa-13_None_text-davinci-003</th>\n",
       "      <th>qa-16_None_text-davinci-003</th>\n",
       "      <th>qa-17_None_text-davinci-003</th>\n",
       "      <th>refl-01_None_text-davinci-003</th>\n",
       "      <th>zhou-01-ins_None_text-davinci-003</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>commonsense_qa</td>\n",
       "      <td>0.52</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.73</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.76</td>\n",
       "      <td>0.67</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.70</td>\n",
       "      <td>...</td>\n",
       "      <td>0.73</td>\n",
       "      <td>0.67</td>\n",
       "      <td>0.67</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.79</td>\n",
       "      <td>0.67</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.76</td>\n",
       "      <td>0.73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>med_qa</td>\n",
       "      <td>0.18</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.27</td>\n",
       "      <td>0.27</td>\n",
       "      <td>0.27</td>\n",
       "      <td>0.24</td>\n",
       "      <td>0.33</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.21</td>\n",
       "      <td>...</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.33</td>\n",
       "      <td>0.39</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.39</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.24</td>\n",
       "      <td>0.33</td>\n",
       "      <td>0.36</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>medmc_qa</td>\n",
       "      <td>0.27</td>\n",
       "      <td>0.15</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.27</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.24</td>\n",
       "      <td>...</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.45</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.39</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.39</td>\n",
       "      <td>0.33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>open_book_qa</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.55</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.61</td>\n",
       "      <td>...</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.79</td>\n",
       "      <td>0.73</td>\n",
       "      <td>0.79</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.73</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>strategy_qa</td>\n",
       "      <td>0.55</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.24</td>\n",
       "      <td>0.12</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.12</td>\n",
       "      <td>0.33</td>\n",
       "      <td>0.30</td>\n",
       "      <td>0.06</td>\n",
       "      <td>...</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.67</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.55</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>worldtree</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.76</td>\n",
       "      <td>0.73</td>\n",
       "      <td>0.82</td>\n",
       "      <td>0.85</td>\n",
       "      <td>0.85</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.79</td>\n",
       "      <td>...</td>\n",
       "      <td>0.94</td>\n",
       "      <td>0.91</td>\n",
       "      <td>0.82</td>\n",
       "      <td>0.82</td>\n",
       "      <td>0.91</td>\n",
       "      <td>0.85</td>\n",
       "      <td>0.82</td>\n",
       "      <td>0.91</td>\n",
       "      <td>0.91</td>\n",
       "      <td>0.88</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Average</td>\n",
       "      <td>0.45</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.51</td>\n",
       "      <td>0.44</td>\n",
       "      <td>0.46</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.52</td>\n",
       "      <td>0.47</td>\n",
       "      <td>0.43</td>\n",
       "      <td>...</td>\n",
       "      <td>0.60</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.63</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.60</td>\n",
       "      <td>0.56</td>\n",
       "      <td>0.59</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.63</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>7 rows × 61 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          dataset  None_None_command-xlarge-nightly  \\\n",
       "0  commonsense_qa                              0.52   \n",
       "1          med_qa                              0.18   \n",
       "2        medmc_qa                              0.27   \n",
       "3    open_book_qa                              0.58   \n",
       "4     strategy_qa                              0.55   \n",
       "5       worldtree                              0.61   \n",
       "6         Average                              0.45   \n",
       "\n",
       "   None_kojima-01_command-xlarge-nightly  None_zhou-01_command-xlarge-nightly  \\\n",
       "0                                   0.48                                 0.73   \n",
       "1                                   0.30                                 0.27   \n",
       "2                                   0.15                                 0.42   \n",
       "3                                   0.42                                 0.61   \n",
       "4                                   0.58                                 0.24   \n",
       "5                                   0.61                                 0.76   \n",
       "6                                   0.42                                 0.51   \n",
       "\n",
       "   qa-10_None_command-xlarge-nightly  qa-12_None_command-xlarge-nightly  \\\n",
       "0                               0.70                               0.70   \n",
       "1                               0.27                               0.27   \n",
       "2                               0.27                               0.30   \n",
       "3                               0.58                               0.58   \n",
       "4                               0.12                               0.09   \n",
       "5                               0.73                               0.82   \n",
       "6                               0.44                               0.46   \n",
       "\n",
       "   qa-13_None_command-xlarge-nightly  qa-16_None_command-xlarge-nightly  \\\n",
       "0                               0.76                               0.67   \n",
       "1                               0.24                               0.33   \n",
       "2                               0.36                               0.36   \n",
       "3                               0.58                               0.55   \n",
       "4                               0.12                               0.33   \n",
       "5                               0.85                               0.85   \n",
       "6                               0.48                               0.52   \n",
       "\n",
       "   qa-17_None_command-xlarge-nightly  refl-01_None_command-xlarge-nightly  \\\n",
       "0                               0.61                                 0.70   \n",
       "1                               0.30                                 0.21   \n",
       "2                               0.36                                 0.24   \n",
       "3                               0.61                                 0.61   \n",
       "4                               0.30                                 0.06   \n",
       "5                               0.64                                 0.79   \n",
       "6                               0.47                                 0.43   \n",
       "\n",
       "   ...  None_None_text-davinci-003  None_kojima-01_text-davinci-003  \\\n",
       "0  ...                        0.73                             0.67   \n",
       "1  ...                        0.30                             0.33   \n",
       "2  ...                        0.36                             0.36   \n",
       "3  ...                        0.64                             0.58   \n",
       "4  ...                        0.61                             0.64   \n",
       "5  ...                        0.94                             0.91   \n",
       "6  ...                        0.60                             0.58   \n",
       "\n",
       "   None_zhou-01_text-davinci-003  qa-10_None_text-davinci-003  \\\n",
       "0                           0.67                         0.70   \n",
       "1                           0.39                         0.36   \n",
       "2                           0.48                         0.45   \n",
       "3                           0.79                         0.73   \n",
       "4                           0.64                         0.58   \n",
       "5                           0.82                         0.82   \n",
       "6                           0.63                         0.61   \n",
       "\n",
       "   qa-12_None_text-davinci-003  qa-13_None_text-davinci-003  \\\n",
       "0                         0.79                         0.67   \n",
       "1                         0.30                         0.39   \n",
       "2                         0.36                         0.36   \n",
       "3                         0.79                         0.61   \n",
       "4                         0.67                         0.70   \n",
       "5                         0.91                         0.85   \n",
       "6                         0.64                         0.60   \n",
       "\n",
       "   qa-16_None_text-davinci-003  qa-17_None_text-davinci-003  \\\n",
       "0                         0.58                         0.64   \n",
       "1                         0.36                         0.24   \n",
       "2                         0.39                         0.42   \n",
       "3                         0.64                         0.73   \n",
       "4                         0.55                         0.58   \n",
       "5                         0.82                         0.91   \n",
       "6                         0.56                         0.59   \n",
       "\n",
       "   refl-01_None_text-davinci-003  zhou-01-ins_None_text-davinci-003  \n",
       "0                           0.76                               0.73  \n",
       "1                           0.33                               0.36  \n",
       "2                           0.39                               0.33  \n",
       "3                           0.64                               0.82  \n",
       "4                           0.64                               0.64  \n",
       "5                           0.91                               0.88  \n",
       "6                           0.61                               0.63  \n",
       "\n",
       "[7 rows x 61 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "df = (df[df.dataset==\"Average\"])\n",
    "df = df.drop(['dataset'], axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>None_None_command-xlarge-nightly</th>\n",
       "      <th>None_kojima-01_command-xlarge-nightly</th>\n",
       "      <th>None_zhou-01_command-xlarge-nightly</th>\n",
       "      <th>qa-10_None_command-xlarge-nightly</th>\n",
       "      <th>qa-12_None_command-xlarge-nightly</th>\n",
       "      <th>qa-13_None_command-xlarge-nightly</th>\n",
       "      <th>qa-16_None_command-xlarge-nightly</th>\n",
       "      <th>qa-17_None_command-xlarge-nightly</th>\n",
       "      <th>refl-01_None_command-xlarge-nightly</th>\n",
       "      <th>zhou-01-ins_None_command-xlarge-nightly</th>\n",
       "      <th>...</th>\n",
       "      <th>None_None_text-davinci-003</th>\n",
       "      <th>None_kojima-01_text-davinci-003</th>\n",
       "      <th>None_zhou-01_text-davinci-003</th>\n",
       "      <th>qa-10_None_text-davinci-003</th>\n",
       "      <th>qa-12_None_text-davinci-003</th>\n",
       "      <th>qa-13_None_text-davinci-003</th>\n",
       "      <th>qa-16_None_text-davinci-003</th>\n",
       "      <th>qa-17_None_text-davinci-003</th>\n",
       "      <th>refl-01_None_text-davinci-003</th>\n",
       "      <th>zhou-01-ins_None_text-davinci-003</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.45</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.51</td>\n",
       "      <td>0.44</td>\n",
       "      <td>0.46</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.52</td>\n",
       "      <td>0.47</td>\n",
       "      <td>0.43</td>\n",
       "      <td>0.47</td>\n",
       "      <td>...</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.63</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.56</td>\n",
       "      <td>0.59</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.63</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 60 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   None_None_command-xlarge-nightly  None_kojima-01_command-xlarge-nightly  \\\n",
       "6                              0.45                                   0.42   \n",
       "\n",
       "   None_zhou-01_command-xlarge-nightly  qa-10_None_command-xlarge-nightly  \\\n",
       "6                                 0.51                               0.44   \n",
       "\n",
       "   qa-12_None_command-xlarge-nightly  qa-13_None_command-xlarge-nightly  \\\n",
       "6                               0.46                               0.48   \n",
       "\n",
       "   qa-16_None_command-xlarge-nightly  qa-17_None_command-xlarge-nightly  \\\n",
       "6                               0.52                               0.47   \n",
       "\n",
       "   refl-01_None_command-xlarge-nightly  \\\n",
       "6                                 0.43   \n",
       "\n",
       "   zhou-01-ins_None_command-xlarge-nightly  ...  None_None_text-davinci-003  \\\n",
       "6                                     0.47  ...                         0.6   \n",
       "\n",
       "   None_kojima-01_text-davinci-003  None_zhou-01_text-davinci-003  \\\n",
       "6                             0.58                           0.63   \n",
       "\n",
       "   qa-10_None_text-davinci-003  qa-12_None_text-davinci-003  \\\n",
       "6                         0.61                         0.64   \n",
       "\n",
       "   qa-13_None_text-davinci-003  qa-16_None_text-davinci-003  \\\n",
       "6                          0.6                         0.56   \n",
       "\n",
       "   qa-17_None_text-davinci-003  refl-01_None_text-davinci-003  \\\n",
       "6                         0.59                           0.61   \n",
       "\n",
       "   zhou-01-ins_None_text-davinci-003  \n",
       "6                               0.63  \n",
       "\n",
       "[1 rows x 60 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "new_df = pd.DataFrame(np.reshape(df.values,(6,10)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "rows = ['cohere','flan-t5-xxl','gpt-3.5-turbo','gpt-4','text-davinci-002','text-da-vinci-003']\n",
    "cols = ['None','kojima-01','zhou-01','qa-10','qa-12','qa-13','qa-16','qa-17','refl-01','zhou-01-ins']\n",
    "\n",
    "# Change the column names\n",
    "new_df.columns = cols\n",
    "  \n",
    "# Change the row indexes\n",
    "new_df.index = rows"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "rounded_df = new_df.round(decimals=2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>None</th>\n",
       "      <th>kojima-01</th>\n",
       "      <th>zhou-01</th>\n",
       "      <th>qa-10</th>\n",
       "      <th>qa-12</th>\n",
       "      <th>qa-13</th>\n",
       "      <th>qa-16</th>\n",
       "      <th>qa-17</th>\n",
       "      <th>refl-01</th>\n",
       "      <th>zhou-01-ins</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>cohere</th>\n",
       "      <td>0.45</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.51</td>\n",
       "      <td>0.44</td>\n",
       "      <td>0.46</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.52</td>\n",
       "      <td>0.47</td>\n",
       "      <td>0.43</td>\n",
       "      <td>0.47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>flan-t5-xxl</th>\n",
       "      <td>0.62</td>\n",
       "      <td>0.62</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.60</td>\n",
       "      <td>0.63</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.54</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.57</td>\n",
       "      <td>0.59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>gpt-3.5-turbo</th>\n",
       "      <td>0.71</td>\n",
       "      <td>0.69</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.67</td>\n",
       "      <td>0.67</td>\n",
       "      <td>0.66</td>\n",
       "      <td>0.65</td>\n",
       "      <td>0.68</td>\n",
       "      <td>0.65</td>\n",
       "      <td>0.67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>gpt-4</th>\n",
       "      <td>0.79</td>\n",
       "      <td>0.83</td>\n",
       "      <td>0.86</td>\n",
       "      <td>0.83</td>\n",
       "      <td>0.80</td>\n",
       "      <td>0.82</td>\n",
       "      <td>0.80</td>\n",
       "      <td>0.78</td>\n",
       "      <td>0.80</td>\n",
       "      <td>0.81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>text-davinci-002</th>\n",
       "      <td>0.55</td>\n",
       "      <td>0.49</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.53</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.57</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.49</td>\n",
       "      <td>0.54</td>\n",
       "      <td>0.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>text-da-vinci-003</th>\n",
       "      <td>0.60</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.63</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.60</td>\n",
       "      <td>0.56</td>\n",
       "      <td>0.59</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.63</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   None  kojima-01  zhou-01  qa-10  qa-12  qa-13  qa-16  \\\n",
       "cohere             0.45       0.42     0.51   0.44   0.46   0.48   0.52   \n",
       "flan-t5-xxl        0.62       0.62     0.58   0.60   0.63   0.61   0.54   \n",
       "gpt-3.5-turbo      0.71       0.69     0.70   0.67   0.67   0.66   0.65   \n",
       "gpt-4              0.79       0.83     0.86   0.83   0.80   0.82   0.80   \n",
       "text-davinci-002   0.55       0.49     0.61   0.53   0.58   0.57   0.61   \n",
       "text-da-vinci-003  0.60       0.58     0.63   0.61   0.64   0.60   0.56   \n",
       "\n",
       "                   qa-17  refl-01  zhou-01-ins  \n",
       "cohere              0.47     0.43         0.47  \n",
       "flan-t5-xxl         0.61     0.57         0.59  \n",
       "gpt-3.5-turbo       0.68     0.65         0.67  \n",
       "gpt-4               0.78     0.80         0.81  \n",
       "text-davinci-002    0.49     0.54         0.53  \n",
       "text-da-vinci-003   0.59     0.61         0.63  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rounded_df\n",
    "#zhou better than instruction"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Experiment with table to docs/word"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "|   None |   kojima-01 |   zhou-01 |   qa-10 |   qa-12 |   qa-13 |   qa-16 |   qa-17 |   refl-01 |   zhou-01-ins |\n",
      "|-------:|------------:|----------:|--------:|--------:|--------:|--------:|--------:|----------:|--------------:|\n",
      "|   0.45 |        0.42 |      0.51 |    0.44 |    0.46 |    0.48 |    0.52 |    0.47 |      0.43 |          0.47 |\n",
      "|   0.62 |        0.62 |      0.58 |    0.6  |    0.63 |    0.61 |    0.54 |    0.61 |      0.57 |          0.59 |\n",
      "|   0.71 |        0.69 |      0.7  |    0.67 |    0.67 |    0.66 |    0.65 |    0.68 |      0.65 |          0.67 |\n",
      "|   0.79 |        0.83 |      0.86 |    0.83 |    0.8  |    0.82 |    0.8  |    0.78 |      0.8  |          0.81 |\n",
      "|   0.55 |        0.49 |      0.61 |    0.53 |    0.58 |    0.57 |    0.61 |    0.49 |      0.54 |          0.53 |\n",
      "|   0.6  |        0.58 |      0.63 |    0.61 |    0.64 |    0.6  |    0.56 |    0.59 |      0.61 |          0.63 |\n"
     ]
    }
   ],
   "source": [
    "#export to word\n",
    "from tabulate import tabulate\n",
    "# Convert the DataFrame to a formatted table string\n",
    "table_str = tabulate(new_df, headers='keys', tablefmt='pipe', showindex=False) #word\n",
    "#table_str = tabulate(df, headers='keys', tablefmt='tsv', showindex=False) #google docs\n",
    "print(table_str)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting python-docx\n",
      "  Downloading python-docx-0.8.11.tar.gz (5.6 MB)\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.6/5.6 MB\u001b[0m \u001b[31m10.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
      "\u001b[?25h  Preparing metadata (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25hRequirement already satisfied: lxml>=2.3.2 in /opt/anaconda3/lib/python3.9/site-packages (from python-docx) (4.9.0)\n",
      "Building wheels for collected packages: python-docx\n",
      "  Building wheel for python-docx (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for python-docx: filename=python_docx-0.8.11-py3-none-any.whl size=184507 sha256=75a440616c6bd622216689bca7192ae5d7e00051f1055873f78b8fb8e4274e38\n",
      "  Stored in directory: /Users/robertpraas/Library/Caches/pip/wheels/83/8b/7c/09ae60c42c7ba4ed2dddaf2b8b9186cb105255856d6ed3dba5\n",
      "Successfully built python-docx\n",
      "Installing collected packages: python-docx\n",
      "Successfully installed python-docx-0.8.11\n",
      "\n",
      "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip available: \u001b[0m\u001b[31;49m22.1.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.1\u001b[0m\n",
      "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n",
      "Note: you may need to restart the kernel to use updated packages.\n"
     ]
    }
   ],
   "source": [
    "pip install python-docx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "import docx\n",
    "\n",
    "# i am not sure how you are getting your data, but you said it is a\n",
    "# pandas data frame\n",
    "df = new_df\n",
    "\n",
    "# open an existing document\n",
    "doc = docx.Document()\n",
    "\n",
    "# add a table to the end and create a reference variable\n",
    "# extra row is so we can add the header row\n",
    "t = doc.add_table(df.shape[0]+1, df.shape[1])\n",
    "\n",
    "# add the header rows.\n",
    "for j in range(df.shape[-1]):\n",
    "    t.cell(0,j).text = df.columns[j]\n",
    "\n",
    "# add the rest of the data frame\n",
    "for i in range(df.shape[0]):\n",
    "    for j in range(df.shape[-1]):\n",
    "        t.cell(i+1,j).text = str(df.values[i,j])\n",
    "\n",
    "# save the doc\n",
    "doc.save('./test.docx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#to google docs:\n",
    "#https://thepolicylab.brown.edu/reflections/zentables-stress-free-table-publishing-in-google-docs-with-python"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">\n",
       "</style>\n",
       "\n",
       "\n",
       "\n",
       "<table id=\"T_55792\" style=\"border-collapse: collapse; \">\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "<thead>\n",
       "\n",
       "\n",
       "\n",
       "    <tr style=\"padding: 0; margin: 0;\">\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"blank level0\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >&nbsp;</th>\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"col_heading level0 col0\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >None</th>\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"col_heading level0 col1\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >kojima-01</th>\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"col_heading level0 col2\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >zhou-01</th>\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"col_heading level0 col3\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >qa-10</th>\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"col_heading level0 col4\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >qa-12</th>\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"col_heading level0 col5\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >qa-13</th>\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"col_heading level0 col6\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >qa-16</th>\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"col_heading level0 col7\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >qa-17</th>\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"col_heading level0 col8\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >refl-01</th>\n",
       "\n",
       "\n",
       "\n",
       "      <th class=\"col_heading level0 col9\"  style=\"text-align: center; border-top: 1.5pt solid black; border-bottom: 1.5pt solid black\" >zhou-01-ins</th>\n",
       "\n",
       "\n",
       "\n",
       "    </tr>\n",
       "\n",
       "\n",
       "\n",
       "</thead>\n",
       "\n",
       "\n",
       "<tbody>\n",
       "\n",
       "\n",
       "\n",
       "    <tr style=\"background-color: white; padding: 0; margin: 0;\">\n",
       "\n",
       "\n",
       "      <th id=\"T_55792level0_row0\" class=\"row_heading level0 row0\"  style=\"vertical-align: middle; text-align: left\" >cohere</th>\n",
       "\n",
       "      <td id=\"T_55792row0_col0\" class=\"data row0 col0\"  style=\"vertical-align: middle; text-align: center\" >0.450000</td>\n",
       "\n",
       "      <td id=\"T_55792row0_col1\" class=\"data row0 col1\"  style=\"vertical-align: middle; text-align: center\" >0.420000</td>\n",
       "\n",
       "      <td id=\"T_55792row0_col2\" class=\"data row0 col2\"  style=\"vertical-align: middle; text-align: center\" >0.510000</td>\n",
       "\n",
       "      <td id=\"T_55792row0_col3\" class=\"data row0 col3\"  style=\"vertical-align: middle; text-align: center\" >0.440000</td>\n",
       "\n",
       "      <td id=\"T_55792row0_col4\" class=\"data row0 col4\"  style=\"vertical-align: middle; text-align: center\" >0.460000</td>\n",
       "\n",
       "      <td id=\"T_55792row0_col5\" class=\"data row0 col5\"  style=\"vertical-align: middle; text-align: center\" >0.480000</td>\n",
       "\n",
       "      <td id=\"T_55792row0_col6\" class=\"data row0 col6\"  style=\"vertical-align: middle; text-align: center\" >0.520000</td>\n",
       "\n",
       "      <td id=\"T_55792row0_col7\" class=\"data row0 col7\"  style=\"vertical-align: middle; text-align: center\" >0.470000</td>\n",
       "\n",
       "      <td id=\"T_55792row0_col8\" class=\"data row0 col8\"  style=\"vertical-align: middle; text-align: center\" >0.430000</td>\n",
       "\n",
       "      <td id=\"T_55792row0_col9\" class=\"data row0 col9\"  style=\"vertical-align: middle; text-align: center\" >0.470000</td>\n",
       "\n",
       "\n",
       "    </tr>\n",
       "\n",
       "\n",
       "\n",
       "    <tr style=\"background-color: white; padding: 0; margin: 0;\">\n",
       "\n",
       "\n",
       "      <th id=\"T_55792level0_row1\" class=\"row_heading level0 row1\"  style=\"vertical-align: middle; text-align: left\" >flan-t5-xxl</th>\n",
       "\n",
       "      <td id=\"T_55792row1_col0\" class=\"data row1 col0\"  style=\"vertical-align: middle; text-align: center\" >0.620000</td>\n",
       "\n",
       "      <td id=\"T_55792row1_col1\" class=\"data row1 col1\"  style=\"vertical-align: middle; text-align: center\" >0.620000</td>\n",
       "\n",
       "      <td id=\"T_55792row1_col2\" class=\"data row1 col2\"  style=\"vertical-align: middle; text-align: center\" >0.580000</td>\n",
       "\n",
       "      <td id=\"T_55792row1_col3\" class=\"data row1 col3\"  style=\"vertical-align: middle; text-align: center\" >0.600000</td>\n",
       "\n",
       "      <td id=\"T_55792row1_col4\" class=\"data row1 col4\"  style=\"vertical-align: middle; text-align: center\" >0.630000</td>\n",
       "\n",
       "      <td id=\"T_55792row1_col5\" class=\"data row1 col5\"  style=\"vertical-align: middle; text-align: center\" >0.610000</td>\n",
       "\n",
       "      <td id=\"T_55792row1_col6\" class=\"data row1 col6\"  style=\"vertical-align: middle; text-align: center\" >0.540000</td>\n",
       "\n",
       "      <td id=\"T_55792row1_col7\" class=\"data row1 col7\"  style=\"vertical-align: middle; text-align: center\" >0.610000</td>\n",
       "\n",
       "      <td id=\"T_55792row1_col8\" class=\"data row1 col8\"  style=\"vertical-align: middle; text-align: center\" >0.570000</td>\n",
       "\n",
       "      <td id=\"T_55792row1_col9\" class=\"data row1 col9\"  style=\"vertical-align: middle; text-align: center\" >0.590000</td>\n",
       "\n",
       "\n",
       "    </tr>\n",
       "\n",
       "\n",
       "\n",
       "    <tr style=\"background-color: white; padding: 0; margin: 0;\">\n",
       "\n",
       "\n",
       "      <th id=\"T_55792level0_row2\" class=\"row_heading level0 row2\"  style=\"vertical-align: middle; text-align: left\" >gpt-3.5-turbo</th>\n",
       "\n",
       "      <td id=\"T_55792row2_col0\" class=\"data row2 col0\"  style=\"vertical-align: middle; text-align: center\" >0.710000</td>\n",
       "\n",
       "      <td id=\"T_55792row2_col1\" class=\"data row2 col1\"  style=\"vertical-align: middle; text-align: center\" >0.690000</td>\n",
       "\n",
       "      <td id=\"T_55792row2_col2\" class=\"data row2 col2\"  style=\"vertical-align: middle; text-align: center\" >0.700000</td>\n",
       "\n",
       "      <td id=\"T_55792row2_col3\" class=\"data row2 col3\"  style=\"vertical-align: middle; text-align: center\" >0.670000</td>\n",
       "\n",
       "      <td id=\"T_55792row2_col4\" class=\"data row2 col4\"  style=\"vertical-align: middle; text-align: center\" >0.670000</td>\n",
       "\n",
       "      <td id=\"T_55792row2_col5\" class=\"data row2 col5\"  style=\"vertical-align: middle; text-align: center\" >0.660000</td>\n",
       "\n",
       "      <td id=\"T_55792row2_col6\" class=\"data row2 col6\"  style=\"vertical-align: middle; text-align: center\" >0.650000</td>\n",
       "\n",
       "      <td id=\"T_55792row2_col7\" class=\"data row2 col7\"  style=\"vertical-align: middle; text-align: center\" >0.680000</td>\n",
       "\n",
       "      <td id=\"T_55792row2_col8\" class=\"data row2 col8\"  style=\"vertical-align: middle; text-align: center\" >0.650000</td>\n",
       "\n",
       "      <td id=\"T_55792row2_col9\" class=\"data row2 col9\"  style=\"vertical-align: middle; text-align: center\" >0.670000</td>\n",
       "\n",
       "\n",
       "    </tr>\n",
       "\n",
       "\n",
       "\n",
       "    <tr style=\"background-color: white; padding: 0; margin: 0;\">\n",
       "\n",
       "\n",
       "      <th id=\"T_55792level0_row3\" class=\"row_heading level0 row3\"  style=\"vertical-align: middle; text-align: left\" >gpt-4</th>\n",
       "\n",
       "      <td id=\"T_55792row3_col0\" class=\"data row3 col0\"  style=\"vertical-align: middle; text-align: center\" >0.790000</td>\n",
       "\n",
       "      <td id=\"T_55792row3_col1\" class=\"data row3 col1\"  style=\"vertical-align: middle; text-align: center\" >0.830000</td>\n",
       "\n",
       "      <td id=\"T_55792row3_col2\" class=\"data row3 col2\"  style=\"vertical-align: middle; text-align: center\" >0.860000</td>\n",
       "\n",
       "      <td id=\"T_55792row3_col3\" class=\"data row3 col3\"  style=\"vertical-align: middle; text-align: center\" >0.830000</td>\n",
       "\n",
       "      <td id=\"T_55792row3_col4\" class=\"data row3 col4\"  style=\"vertical-align: middle; text-align: center\" >0.800000</td>\n",
       "\n",
       "      <td id=\"T_55792row3_col5\" class=\"data row3 col5\"  style=\"vertical-align: middle; text-align: center\" >0.820000</td>\n",
       "\n",
       "      <td id=\"T_55792row3_col6\" class=\"data row3 col6\"  style=\"vertical-align: middle; text-align: center\" >0.800000</td>\n",
       "\n",
       "      <td id=\"T_55792row3_col7\" class=\"data row3 col7\"  style=\"vertical-align: middle; text-align: center\" >0.780000</td>\n",
       "\n",
       "      <td id=\"T_55792row3_col8\" class=\"data row3 col8\"  style=\"vertical-align: middle; text-align: center\" >0.800000</td>\n",
       "\n",
       "      <td id=\"T_55792row3_col9\" class=\"data row3 col9\"  style=\"vertical-align: middle; text-align: center\" >0.810000</td>\n",
       "\n",
       "\n",
       "    </tr>\n",
       "\n",
       "\n",
       "\n",
       "    <tr style=\"background-color: white; padding: 0; margin: 0;\">\n",
       "\n",
       "\n",
       "      <th id=\"T_55792level0_row4\" class=\"row_heading level0 row4\"  style=\"vertical-align: middle; text-align: left\" >text-davinci-002</th>\n",
       "\n",
       "      <td id=\"T_55792row4_col0\" class=\"data row4 col0\"  style=\"vertical-align: middle; text-align: center\" >0.550000</td>\n",
       "\n",
       "      <td id=\"T_55792row4_col1\" class=\"data row4 col1\"  style=\"vertical-align: middle; text-align: center\" >0.490000</td>\n",
       "\n",
       "      <td id=\"T_55792row4_col2\" class=\"data row4 col2\"  style=\"vertical-align: middle; text-align: center\" >0.610000</td>\n",
       "\n",
       "      <td id=\"T_55792row4_col3\" class=\"data row4 col3\"  style=\"vertical-align: middle; text-align: center\" >0.530000</td>\n",
       "\n",
       "      <td id=\"T_55792row4_col4\" class=\"data row4 col4\"  style=\"vertical-align: middle; text-align: center\" >0.580000</td>\n",
       "\n",
       "      <td id=\"T_55792row4_col5\" class=\"data row4 col5\"  style=\"vertical-align: middle; text-align: center\" >0.570000</td>\n",
       "\n",
       "      <td id=\"T_55792row4_col6\" class=\"data row4 col6\"  style=\"vertical-align: middle; text-align: center\" >0.610000</td>\n",
       "\n",
       "      <td id=\"T_55792row4_col7\" class=\"data row4 col7\"  style=\"vertical-align: middle; text-align: center\" >0.490000</td>\n",
       "\n",
       "      <td id=\"T_55792row4_col8\" class=\"data row4 col8\"  style=\"vertical-align: middle; text-align: center\" >0.540000</td>\n",
       "\n",
       "      <td id=\"T_55792row4_col9\" class=\"data row4 col9\"  style=\"vertical-align: middle; text-align: center\" >0.530000</td>\n",
       "\n",
       "\n",
       "    </tr>\n",
       "\n",
       "\n",
       "\n",
       "    <tr style=\"background-color: white; padding: 0; margin: 0;\">\n",
       "\n",
       "\n",
       "      <th id=\"T_55792level0_row5\" class=\"row_heading level0 row5\"  style=\"vertical-align: middle; text-align: left; border-bottom: 1.5pt solid black\" >text-da-vinci-003</th>\n",
       "\n",
       "      <td id=\"T_55792row5_col0\" class=\"data row5 col0\"  style=\"vertical-align: middle; text-align: center; border-bottom: 1.5pt solid black\" >0.600000</td>\n",
       "\n",
       "      <td id=\"T_55792row5_col1\" class=\"data row5 col1\"  style=\"vertical-align: middle; text-align: center; border-bottom: 1.5pt solid black\" >0.580000</td>\n",
       "\n",
       "      <td id=\"T_55792row5_col2\" class=\"data row5 col2\"  style=\"vertical-align: middle; text-align: center; border-bottom: 1.5pt solid black\" >0.630000</td>\n",
       "\n",
       "      <td id=\"T_55792row5_col3\" class=\"data row5 col3\"  style=\"vertical-align: middle; text-align: center; border-bottom: 1.5pt solid black\" >0.610000</td>\n",
       "\n",
       "      <td id=\"T_55792row5_col4\" class=\"data row5 col4\"  style=\"vertical-align: middle; text-align: center; border-bottom: 1.5pt solid black\" >0.640000</td>\n",
       "\n",
       "      <td id=\"T_55792row5_col5\" class=\"data row5 col5\"  style=\"vertical-align: middle; text-align: center; border-bottom: 1.5pt solid black\" >0.600000</td>\n",
       "\n",
       "      <td id=\"T_55792row5_col6\" class=\"data row5 col6\"  style=\"vertical-align: middle; text-align: center; border-bottom: 1.5pt solid black\" >0.560000</td>\n",
       "\n",
       "      <td id=\"T_55792row5_col7\" class=\"data row5 col7\"  style=\"vertical-align: middle; text-align: center; border-bottom: 1.5pt solid black\" >0.590000</td>\n",
       "\n",
       "      <td id=\"T_55792row5_col8\" class=\"data row5 col8\"  style=\"vertical-align: middle; text-align: center; border-bottom: 1.5pt solid black\" >0.610000</td>\n",
       "\n",
       "      <td id=\"T_55792row5_col9\" class=\"data row5 col9\"  style=\"vertical-align: middle; text-align: center; border-bottom: 1.5pt solid black\" >0.630000</td>\n",
       "\n",
       "\n",
       "    </tr>\n",
       "\n",
       "\n",
       "\n",
       "</tbody>\n",
       "\n",
       "</table>\n",
       "\n",
       "\n",
       "\n",
       "<input id=\"B_55792\" type=\"button\" value=\"Copy Table\" />\n",
       "<script language=\"javascript\">\n",
       "document.querySelector(\"#B_55792\").addEventListener(\"click\", function () {\n",
       "  function walkTheDOM(node, func) {\n",
       "    func(node);\n",
       "    node = node.firstChild;\n",
       "    while (node) {\n",
       "        walkTheDOM(node, func);\n",
       "        node = node.nextSibling;\n",
       "    }\n",
       "  }\n",
       "\n",
       "  function removePadding(node) {\n",
       "    if (node.tagName === \"TH\" || node.tagName === \"TD\"){\n",
       "      node.style.padding = \"0 5px\";\n",
       "    }\n",
       "  }\n",
       "\n",
       "  let el = document.getElementById(\"T_55792\");\n",
       "  let parent = el.parentNode;\n",
       "  let elCopy = el.cloneNode(true);\n",
       "\n",
       "  walkTheDOM(elCopy, removePadding);\n",
       "\n",
       "  parent.appendChild(elCopy);\n",
       "\n",
       "  var body = document.body,\n",
       "    range,\n",
       "    sel;\n",
       "  if (document.createRange && window.getSelection) {\n",
       "    range = document.createRange();\n",
       "    sel = window.getSelection();\n",
       "    sel.removeAllRanges();\n",
       "    try {\n",
       "      range.selectNodeContents(elCopy);\n",
       "      sel.addRange(range);\n",
       "    } catch (e) {\n",
       "      range.selectNode(elCopy);\n",
       "      sel.addRange(range);\n",
       "    }\n",
       "  } else if (body.createTextRange) {\n",
       "    range = body.createTextRange();\n",
       "    range.moveToElementText(elCopy);\n",
       "    range.select();\n",
       "  }\n",
       "  document.execCommand(\"copy\");\n",
       "  elCopy.remove();\n",
       "});\n",
       "\n",
       "</script>\n",
       "\n"
      ],
      "text/plain": [
       "<zentables.zentables.PrettyStyler at 0x7fcc18ad27c0>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import zentables as zen\n",
    "rounded_df.zen.pretty()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# make new branch"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Create dataset with average of all datasets\n",
    "df = (df[df.dataset==\"Average\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>None_None_command-xlarge-nightly</th>\n",
       "      <th>None_kojima-01_command-xlarge-nightly</th>\n",
       "      <th>None_zhou-01_command-xlarge-nightly</th>\n",
       "      <th>qa-10_None_command-xlarge-nightly</th>\n",
       "      <th>qa-12_None_command-xlarge-nightly</th>\n",
       "      <th>qa-13_None_command-xlarge-nightly</th>\n",
       "      <th>qa-16_None_command-xlarge-nightly</th>\n",
       "      <th>qa-17_None_command-xlarge-nightly</th>\n",
       "      <th>refl-01_None_command-xlarge-nightly</th>\n",
       "      <th>zhou-01-ins_None_command-xlarge-nightly</th>\n",
       "      <th>...</th>\n",
       "      <th>None_None_text-davinci-003</th>\n",
       "      <th>None_kojima-01_text-davinci-003</th>\n",
       "      <th>None_zhou-01_text-davinci-003</th>\n",
       "      <th>qa-10_None_text-davinci-003</th>\n",
       "      <th>qa-12_None_text-davinci-003</th>\n",
       "      <th>qa-13_None_text-davinci-003</th>\n",
       "      <th>qa-16_None_text-davinci-003</th>\n",
       "      <th>qa-17_None_text-davinci-003</th>\n",
       "      <th>refl-01_None_text-davinci-003</th>\n",
       "      <th>zhou-01-ins_None_text-davinci-003</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.45</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.51</td>\n",
       "      <td>0.44</td>\n",
       "      <td>0.46</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.52</td>\n",
       "      <td>0.47</td>\n",
       "      <td>0.43</td>\n",
       "      <td>0.47</td>\n",
       "      <td>...</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.58</td>\n",
       "      <td>0.63</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.64</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.56</td>\n",
       "      <td>0.59</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.63</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 60 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   None_None_command-xlarge-nightly  None_kojima-01_command-xlarge-nightly  \\\n",
       "6                              0.45                                   0.42   \n",
       "\n",
       "   None_zhou-01_command-xlarge-nightly  qa-10_None_command-xlarge-nightly  \\\n",
       "6                                 0.51                               0.44   \n",
       "\n",
       "   qa-12_None_command-xlarge-nightly  qa-13_None_command-xlarge-nightly  \\\n",
       "6                               0.46                               0.48   \n",
       "\n",
       "   qa-16_None_command-xlarge-nightly  qa-17_None_command-xlarge-nightly  \\\n",
       "6                               0.52                               0.47   \n",
       "\n",
       "   refl-01_None_command-xlarge-nightly  \\\n",
       "6                                 0.43   \n",
       "\n",
       "   zhou-01-ins_None_command-xlarge-nightly  ...  None_None_text-davinci-003  \\\n",
       "6                                     0.47  ...                         0.6   \n",
       "\n",
       "   None_kojima-01_text-davinci-003  None_zhou-01_text-davinci-003  \\\n",
       "6                             0.58                           0.63   \n",
       "\n",
       "   qa-10_None_text-davinci-003  qa-12_None_text-davinci-003  \\\n",
       "6                         0.61                         0.64   \n",
       "\n",
       "   qa-13_None_text-davinci-003  qa-16_None_text-davinci-003  \\\n",
       "6                          0.6                         0.56   \n",
       "\n",
       "   qa-17_None_text-davinci-003  refl-01_None_text-davinci-003  \\\n",
       "6                         0.59                           0.61   \n",
       "\n",
       "   zhou-01-ins_None_text-davinci-003  \n",
       "6                               0.63  \n",
       "\n",
       "[1 rows x 60 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df "
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Get datasets by models"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "df = pd.read_csv(\"Average_values_df.csv\",index_col=False)\n",
    "df.rename(columns={df.columns[0]: 'dataset'},inplace=True)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "def average_grouped_cols(df, group_size=10):\n",
    "    num_groups = df.shape[1] // group_size + (df.shape[1] % group_size > 0)\n",
    "    \n",
    "    result_df = pd.DataFrame()\n",
    "    \n",
    "    for i in range(num_groups):\n",
    "        start_col = i * group_size\n",
    "        end_col = (i + 1) * group_size\n",
    "        group = df.iloc[:, start_col:end_col]\n",
    "        group_avg = group.mean(axis=1)\n",
    "        result_df[f'Group{i+1}Avg'] = group_avg\n",
    "    \n",
    "    return result_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = average_grouped_cols(df, group_size=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Group1Avg</th>\n",
       "      <th>Group2Avg</th>\n",
       "      <th>Group3Avg</th>\n",
       "      <th>Group4Avg</th>\n",
       "      <th>Group5Avg</th>\n",
       "      <th>Group6Avg</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.660</td>\n",
       "      <td>0.835</td>\n",
       "      <td>0.688</td>\n",
       "      <td>0.751</td>\n",
       "      <td>0.694</td>\n",
       "      <td>0.694</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.261</td>\n",
       "      <td>0.210</td>\n",
       "      <td>0.503</td>\n",
       "      <td>0.646</td>\n",
       "      <td>0.270</td>\n",
       "      <td>0.336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.306</td>\n",
       "      <td>0.339</td>\n",
       "      <td>0.597</td>\n",
       "      <td>0.784</td>\n",
       "      <td>0.394</td>\n",
       "      <td>0.390</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.576</td>\n",
       "      <td>0.769</td>\n",
       "      <td>0.760</td>\n",
       "      <td>0.913</td>\n",
       "      <td>0.562</td>\n",
       "      <td>0.697</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.248</td>\n",
       "      <td>0.620</td>\n",
       "      <td>0.601</td>\n",
       "      <td>0.817</td>\n",
       "      <td>0.502</td>\n",
       "      <td>0.625</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.748</td>\n",
       "      <td>0.814</td>\n",
       "      <td>0.910</td>\n",
       "      <td>0.976</td>\n",
       "      <td>0.877</td>\n",
       "      <td>0.877</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.465</td>\n",
       "      <td>0.597</td>\n",
       "      <td>0.675</td>\n",
       "      <td>0.812</td>\n",
       "      <td>0.550</td>\n",
       "      <td>0.605</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Group1Avg  Group2Avg  Group3Avg  Group4Avg  Group5Avg  Group6Avg\n",
       "0      0.660      0.835      0.688      0.751      0.694      0.694\n",
       "1      0.261      0.210      0.503      0.646      0.270      0.336\n",
       "2      0.306      0.339      0.597      0.784      0.394      0.390\n",
       "3      0.576      0.769      0.760      0.913      0.562      0.697\n",
       "4      0.248      0.620      0.601      0.817      0.502      0.625\n",
       "5      0.748      0.814      0.910      0.976      0.877      0.877\n",
       "6      0.465      0.597      0.675      0.812      0.550      0.605"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [],
   "source": [
    "cols = ['cohere','flan-t5-xxl','gpt-3.5-turbo','gpt-4','text-davinci-002','text-da-vinci-003']\n",
    "rows = ['commonsense_qa','med_qa','medmc_qa','open_book_qa','strategy_qa','worldtree','average']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>cohere</th>\n",
       "      <th>flan-t5-xxl</th>\n",
       "      <th>gpt-3.5-turbo</th>\n",
       "      <th>gpt-4</th>\n",
       "      <th>text-davinci-002</th>\n",
       "      <th>text-da-vinci-003</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>commonsense_qa</th>\n",
       "      <td>0.660</td>\n",
       "      <td>0.835</td>\n",
       "      <td>0.688</td>\n",
       "      <td>0.751</td>\n",
       "      <td>0.694</td>\n",
       "      <td>0.694</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>med_qa</th>\n",
       "      <td>0.261</td>\n",
       "      <td>0.210</td>\n",
       "      <td>0.503</td>\n",
       "      <td>0.646</td>\n",
       "      <td>0.270</td>\n",
       "      <td>0.336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>medmc_qa</th>\n",
       "      <td>0.306</td>\n",
       "      <td>0.339</td>\n",
       "      <td>0.597</td>\n",
       "      <td>0.784</td>\n",
       "      <td>0.394</td>\n",
       "      <td>0.390</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>open_book_qa</th>\n",
       "      <td>0.576</td>\n",
       "      <td>0.769</td>\n",
       "      <td>0.760</td>\n",
       "      <td>0.913</td>\n",
       "      <td>0.562</td>\n",
       "      <td>0.697</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>strategy_qa</th>\n",
       "      <td>0.248</td>\n",
       "      <td>0.620</td>\n",
       "      <td>0.601</td>\n",
       "      <td>0.817</td>\n",
       "      <td>0.502</td>\n",
       "      <td>0.625</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>worldtree</th>\n",
       "      <td>0.748</td>\n",
       "      <td>0.814</td>\n",
       "      <td>0.910</td>\n",
       "      <td>0.976</td>\n",
       "      <td>0.877</td>\n",
       "      <td>0.877</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>average</th>\n",
       "      <td>0.465</td>\n",
       "      <td>0.597</td>\n",
       "      <td>0.675</td>\n",
       "      <td>0.812</td>\n",
       "      <td>0.550</td>\n",
       "      <td>0.605</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                cohere  flan-t5-xxl  gpt-3.5-turbo  gpt-4  text-davinci-002  \\\n",
       "commonsense_qa   0.660        0.835          0.688  0.751             0.694   \n",
       "med_qa           0.261        0.210          0.503  0.646             0.270   \n",
       "medmc_qa         0.306        0.339          0.597  0.784             0.394   \n",
       "open_book_qa     0.576        0.769          0.760  0.913             0.562   \n",
       "strategy_qa      0.248        0.620          0.601  0.817             0.502   \n",
       "worldtree        0.748        0.814          0.910  0.976             0.877   \n",
       "average          0.465        0.597          0.675  0.812             0.550   \n",
       "\n",
       "                text-da-vinci-003  \n",
       "commonsense_qa              0.694  \n",
       "med_qa                      0.336  \n",
       "medmc_qa                    0.390  \n",
       "open_book_qa                0.697  \n",
       "strategy_qa                 0.625  \n",
       "worldtree                   0.877  \n",
       "average                     0.605  "
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns = cols\n",
    "df.index = rows\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>commonsense_qa</th>\n",
       "      <th>med_qa</th>\n",
       "      <th>medmc_qa</th>\n",
       "      <th>open_book_qa</th>\n",
       "      <th>strategy_qa</th>\n",
       "      <th>worldtree</th>\n",
       "      <th>average</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>cohere</th>\n",
       "      <td>0.660</td>\n",
       "      <td>0.261</td>\n",
       "      <td>0.306</td>\n",
       "      <td>0.576</td>\n",
       "      <td>0.248</td>\n",
       "      <td>0.748</td>\n",
       "      <td>0.465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>flan-t5-xxl</th>\n",
       "      <td>0.835</td>\n",
       "      <td>0.210</td>\n",
       "      <td>0.339</td>\n",
       "      <td>0.769</td>\n",
       "      <td>0.620</td>\n",
       "      <td>0.814</td>\n",
       "      <td>0.597</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>gpt-3.5-turbo</th>\n",
       "      <td>0.688</td>\n",
       "      <td>0.503</td>\n",
       "      <td>0.597</td>\n",
       "      <td>0.760</td>\n",
       "      <td>0.601</td>\n",
       "      <td>0.910</td>\n",
       "      <td>0.675</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>gpt-4</th>\n",
       "      <td>0.751</td>\n",
       "      <td>0.646</td>\n",
       "      <td>0.784</td>\n",
       "      <td>0.913</td>\n",
       "      <td>0.817</td>\n",
       "      <td>0.976</td>\n",
       "      <td>0.812</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>text-davinci-002</th>\n",
       "      <td>0.694</td>\n",
       "      <td>0.270</td>\n",
       "      <td>0.394</td>\n",
       "      <td>0.562</td>\n",
       "      <td>0.502</td>\n",
       "      <td>0.877</td>\n",
       "      <td>0.550</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>text-da-vinci-003</th>\n",
       "      <td>0.694</td>\n",
       "      <td>0.336</td>\n",
       "      <td>0.390</td>\n",
       "      <td>0.697</td>\n",
       "      <td>0.625</td>\n",
       "      <td>0.877</td>\n",
       "      <td>0.605</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   commonsense_qa  med_qa  medmc_qa  open_book_qa  \\\n",
       "cohere                      0.660   0.261     0.306         0.576   \n",
       "flan-t5-xxl                 0.835   0.210     0.339         0.769   \n",
       "gpt-3.5-turbo               0.688   0.503     0.597         0.760   \n",
       "gpt-4                       0.751   0.646     0.784         0.913   \n",
       "text-davinci-002            0.694   0.270     0.394         0.562   \n",
       "text-da-vinci-003           0.694   0.336     0.390         0.697   \n",
       "\n",
       "                   strategy_qa  worldtree  average  \n",
       "cohere                   0.248      0.748    0.465  \n",
       "flan-t5-xxl              0.620      0.814    0.597  \n",
       "gpt-3.5-turbo            0.601      0.910    0.675  \n",
       "gpt-4                    0.817      0.976    0.812  \n",
       "text-davinci-002         0.502      0.877    0.550  \n",
       "text-da-vinci-003        0.625      0.877    0.605  "
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.T"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Get datasets by prompts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [],
   "source": [
    "#select by prompt\n",
    "import pandas as pd\n",
    "\n",
    "def average_col_groups(df):\n",
    "    max_col_index = df.shape[1]\n",
    "    result_df = pd.DataFrame()\n",
    "\n",
    "    for start_col in range(0, 10):\n",
    "        columns = list(range(start_col, max_col_index, 10))\n",
    "        group = df.iloc[:, columns]\n",
    "        group_avg = group.mean(axis=1)\n",
    "        result_df[f'Group{start_col+1}Avg'] = group_avg\n",
    "\n",
    "    return result_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "df = pd.read_csv(\"Average_values_df.csv\",index_col=False)\n",
    "\n",
    "df.rename(columns={df.columns[0]: 'dataset'},inplace=True)\n",
    "#models als rows\n",
    "#after 10th col, row for every 10 cols\n",
    "df = df.drop(['dataset'], axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = average_col_groups(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Group1Avg</th>\n",
       "      <th>Group2Avg</th>\n",
       "      <th>Group3Avg</th>\n",
       "      <th>Group4Avg</th>\n",
       "      <th>Group5Avg</th>\n",
       "      <th>Group6Avg</th>\n",
       "      <th>Group7Avg</th>\n",
       "      <th>Group8Avg</th>\n",
       "      <th>Group9Avg</th>\n",
       "      <th>Group10Avg</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.725000</td>\n",
       "      <td>0.698333</td>\n",
       "      <td>0.720000</td>\n",
       "      <td>0.755000</td>\n",
       "      <td>0.725000</td>\n",
       "      <td>0.745000</td>\n",
       "      <td>0.665000</td>\n",
       "      <td>0.650000</td>\n",
       "      <td>0.760000</td>\n",
       "      <td>0.760000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.368333</td>\n",
       "      <td>0.373333</td>\n",
       "      <td>0.393333</td>\n",
       "      <td>0.356667</td>\n",
       "      <td>0.383333</td>\n",
       "      <td>0.366667</td>\n",
       "      <td>0.396667</td>\n",
       "      <td>0.363333</td>\n",
       "      <td>0.351667</td>\n",
       "      <td>0.356667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.453333</td>\n",
       "      <td>0.423333</td>\n",
       "      <td>0.528333</td>\n",
       "      <td>0.473333</td>\n",
       "      <td>0.493333</td>\n",
       "      <td>0.468333</td>\n",
       "      <td>0.510000</td>\n",
       "      <td>0.483333</td>\n",
       "      <td>0.418333</td>\n",
       "      <td>0.431667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.730000</td>\n",
       "      <td>0.683333</td>\n",
       "      <td>0.780000</td>\n",
       "      <td>0.725000</td>\n",
       "      <td>0.740000</td>\n",
       "      <td>0.658333</td>\n",
       "      <td>0.665000</td>\n",
       "      <td>0.698333</td>\n",
       "      <td>0.725000</td>\n",
       "      <td>0.723333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.583333</td>\n",
       "      <td>0.633333</td>\n",
       "      <td>0.596667</td>\n",
       "      <td>0.521667</td>\n",
       "      <td>0.521667</td>\n",
       "      <td>0.608333</td>\n",
       "      <td>0.608333</td>\n",
       "      <td>0.591667</td>\n",
       "      <td>0.491667</td>\n",
       "      <td>0.531667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.870000</td>\n",
       "      <td>0.830000</td>\n",
       "      <td>0.870000</td>\n",
       "      <td>0.855000</td>\n",
       "      <td>0.915000</td>\n",
       "      <td>0.890000</td>\n",
       "      <td>0.835000</td>\n",
       "      <td>0.840000</td>\n",
       "      <td>0.865000</td>\n",
       "      <td>0.900000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.620000</td>\n",
       "      <td>0.605000</td>\n",
       "      <td>0.648333</td>\n",
       "      <td>0.613333</td>\n",
       "      <td>0.630000</td>\n",
       "      <td>0.623333</td>\n",
       "      <td>0.613333</td>\n",
       "      <td>0.603333</td>\n",
       "      <td>0.600000</td>\n",
       "      <td>0.616667</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Group1Avg  Group2Avg  Group3Avg  Group4Avg  Group5Avg  Group6Avg  \\\n",
       "0   0.725000   0.698333   0.720000   0.755000   0.725000   0.745000   \n",
       "1   0.368333   0.373333   0.393333   0.356667   0.383333   0.366667   \n",
       "2   0.453333   0.423333   0.528333   0.473333   0.493333   0.468333   \n",
       "3   0.730000   0.683333   0.780000   0.725000   0.740000   0.658333   \n",
       "4   0.583333   0.633333   0.596667   0.521667   0.521667   0.608333   \n",
       "5   0.870000   0.830000   0.870000   0.855000   0.915000   0.890000   \n",
       "6   0.620000   0.605000   0.648333   0.613333   0.630000   0.623333   \n",
       "\n",
       "   Group7Avg  Group8Avg  Group9Avg  Group10Avg  \n",
       "0   0.665000   0.650000   0.760000    0.760000  \n",
       "1   0.396667   0.363333   0.351667    0.356667  \n",
       "2   0.510000   0.483333   0.418333    0.431667  \n",
       "3   0.665000   0.698333   0.725000    0.723333  \n",
       "4   0.608333   0.591667   0.491667    0.531667  \n",
       "5   0.835000   0.840000   0.865000    0.900000  \n",
       "6   0.613333   0.603333   0.600000    0.616667  "
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>None</th>\n",
       "      <th>kojima-01</th>\n",
       "      <th>zhou-01</th>\n",
       "      <th>qa-10</th>\n",
       "      <th>qa-12</th>\n",
       "      <th>qa-13</th>\n",
       "      <th>qa-16</th>\n",
       "      <th>qa-17</th>\n",
       "      <th>refl-01</th>\n",
       "      <th>zhou-01-ins</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>commonsense_qa</th>\n",
       "      <td>0.72</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.72</td>\n",
       "      <td>0.76</td>\n",
       "      <td>0.72</td>\n",
       "      <td>0.74</td>\n",
       "      <td>0.66</td>\n",
       "      <td>0.65</td>\n",
       "      <td>0.76</td>\n",
       "      <td>0.76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>med_qa</th>\n",
       "      <td>0.37</td>\n",
       "      <td>0.37</td>\n",
       "      <td>0.39</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.38</td>\n",
       "      <td>0.37</td>\n",
       "      <td>0.40</td>\n",
       "      <td>0.36</td>\n",
       "      <td>0.35</td>\n",
       "      <td>0.36</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>medmc_qa</th>\n",
       "      <td>0.45</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.53</td>\n",
       "      <td>0.47</td>\n",
       "      <td>0.49</td>\n",
       "      <td>0.47</td>\n",
       "      <td>0.51</td>\n",
       "      <td>0.48</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0.43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>open_book_qa</th>\n",
       "      <td>0.73</td>\n",
       "      <td>0.68</td>\n",
       "      <td>0.78</td>\n",
       "      <td>0.72</td>\n",
       "      <td>0.74</td>\n",
       "      <td>0.66</td>\n",
       "      <td>0.66</td>\n",
       "      <td>0.70</td>\n",
       "      <td>0.72</td>\n",
       "      <td>0.72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>strategy_qa</th>\n",
       "      <td>0.58</td>\n",
       "      <td>0.63</td>\n",
       "      <td>0.60</td>\n",
       "      <td>0.52</td>\n",
       "      <td>0.52</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.59</td>\n",
       "      <td>0.49</td>\n",
       "      <td>0.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>worldtree</th>\n",
       "      <td>0.87</td>\n",
       "      <td>0.83</td>\n",
       "      <td>0.87</td>\n",
       "      <td>0.86</td>\n",
       "      <td>0.92</td>\n",
       "      <td>0.89</td>\n",
       "      <td>0.84</td>\n",
       "      <td>0.84</td>\n",
       "      <td>0.87</td>\n",
       "      <td>0.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>average</th>\n",
       "      <td>0.62</td>\n",
       "      <td>0.60</td>\n",
       "      <td>0.65</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.63</td>\n",
       "      <td>0.62</td>\n",
       "      <td>0.61</td>\n",
       "      <td>0.60</td>\n",
       "      <td>0.60</td>\n",
       "      <td>0.62</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                None  kojima-01  zhou-01  qa-10  qa-12  qa-13  qa-16  qa-17  \\\n",
       "commonsense_qa  0.72       0.70     0.72   0.76   0.72   0.74   0.66   0.65   \n",
       "med_qa          0.37       0.37     0.39   0.36   0.38   0.37   0.40   0.36   \n",
       "medmc_qa        0.45       0.42     0.53   0.47   0.49   0.47   0.51   0.48   \n",
       "open_book_qa    0.73       0.68     0.78   0.72   0.74   0.66   0.66   0.70   \n",
       "strategy_qa     0.58       0.63     0.60   0.52   0.52   0.61   0.61   0.59   \n",
       "worldtree       0.87       0.83     0.87   0.86   0.92   0.89   0.84   0.84   \n",
       "average         0.62       0.60     0.65   0.61   0.63   0.62   0.61   0.60   \n",
       "\n",
       "                refl-01  zhou-01-ins  \n",
       "commonsense_qa     0.76         0.76  \n",
       "med_qa             0.35         0.36  \n",
       "medmc_qa           0.42         0.43  \n",
       "open_book_qa       0.72         0.72  \n",
       "strategy_qa        0.49         0.53  \n",
       "worldtree          0.87         0.90  \n",
       "average            0.60         0.62  "
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cols = ['None','kojima-01','zhou-01','qa-10','qa-12','qa-13','qa-16','qa-17','refl-01','zhou-01-ins']\n",
    "rows = ['commonsense_qa','med_qa','medmc_qa','open_book_qa','strategy_qa','worldtree','average']\n",
    "df.columns = cols\n",
    "  \n",
    "# Change the row indexes\n",
    "df.index = rows\n",
    "rounded_df = df.round(decimals=2)\n",
    "rounded_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#double check an average value\n",
    "df = df.drop(['dataset'], axis=1)\n",
    "df = df.iloc[:, :10]\n",
    "average_first_row = df.iloc[0].mean()\n",
    "average_first_row"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "40d3a090f54c6569ab1632332b64b2c03c39dcf918b08424e98f38b5ae0af88f"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
